function [option,iargs] = parseOption(iargs,name,default)
ind = find(strncmpi(iargs,name,numel(name))) ;
if isempty(ind)
    option = default ;
else
    option = iargs{ind+1} ;
    iargs(ind:ind+1) = [] ;
end
end
